import request from '@/utils/request'

// 商品结算 表格数据
export function getCSTableData(perPage, page) {
  const data = { perPage, page }
  return request({
    url: 'api/v1/backend/elm/bill/index',
    method: 'post',
    data
  })
}

// 商品结算 点击 结算 跳转 结算页 表格数据
export function getSTableData(businessId, perPage, page) {
  const data = { businessId, perPage, page }
  return request({
    url: 'api/v1/backend/elm/bill/list',
    method: 'post',
    data
  })
}

// 结算列表 页 点击 结算 调用 结算api
export function getSettlement(businessId) {
  const data = { businessId }
  return request({
    url: 'api/v1/backend/elm/bill/settle',
    method: 'post',
    data
  })
}

// 点击 商品结算 页的 详情 跳转的 历史结算汇总 页
export function getHistorySettlement(businessId, perPage, page) {
  const data = { businessId, perPage, page }
  return request({
    url: 'api/v1/backend/elm/bill/settle/list',
    method: 'post',
    data
  })
}

// 结算单详情 表格数据 最后要导出的表
export function getSDTableData(settleAccountOrderNo, perPage, page) {
  const data = { settleAccountOrderNo, perPage, page }
  return request({
    url: 'api/v1/backend/elm/bill/settle/detail/list',
    method: 'post',
    data
  })
}

// 点击导出
export function getExcel(settleAccountOrderNo) {
  const data = { settleAccountOrderNo }
  return request({
    url: 'api/v1/backend/elm/bill/list/excel',
    method: 'post',
    data
  })
}
